﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Azad.BCL;
using BCL.Entity;
using System.Data;
using NazSoft.Framework;

public partial class Admin_LookUpCode : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        LookUp loockup = new LookUp();
        loockup.ExtraData = txtUrduName.Text;
        loockup.Description = txtScriptName.Text;

        Save(loockup);


    }
    public int Save(LookUp feedback)
    {
        object[] objName = { "ExtraData", "Description" };
        object[] objValue = { feedback.ExtraData, feedback.Description };

        var parameter = new System.Data.SqlClient.SqlParameter("@Id", 0);

        parameter.Direction = ParameterDirection.Output;

        SqlHelper helpclass = new SqlHelper();
        var result = helpclass.ExecuteNonQuery("InsertLookUp", objName, objValue, (cmd) =>
        {
            cmd.Parameters.Add(parameter);
        });
        int Id = Convert.ToString(parameter.Value).ToInt32Safe();


        return Id;
    }
}